
var load_time = 800; // 场景过渡延迟时间
var images = {};
var canvas, stage, container, images = {};
	

var tips_num;
var move_on = false;
var move_p = 3;	// 其实右滑栏目
var startX,x;
function touchSatrt(e){//触摸
    e.preventDefault();
    var touch=e.touches[0];
    startX = touch.pageX;   //刚触摸时的坐标              
}
function touchMove(e){//滑动          
    e.preventDefault();        
    var  touch = e.touches[0];               
    y = touch.pageX - startX;//滑动的距离     
    if(y < -50 && move_on){
    	move_on = false;
	    if(move_p == 10){
			$('#close-left').animate({'left':'0px'});
			$('#close-right').animate({'right':'0px'});
			$('.title_active').removeClass('title_active');
			setTimeout(function(){
				$('#title').remove();
				$('#close-left-1').animate({'left':'-640px'},600);
				$('#close-right-1').animate({'right':'-640px'},600);
	    		page_3();
			},load_time);
	    }else if(tips_num == 0){
	    	p0_next();
	    }else{
    		move_p++;
	    	canvas_close(tips_num,'canvas_p'+move_p);
	    }
    }
}  

function touchEnd(e){//手指离开屏幕
  	e.preventDefault();                   
}
document.getElementById("page-2").addEventListener('touchstart', touchSatrt,false);  
document.getElementById("page-2").addEventListener('touchmove', touchMove,false);  
document.getElementById("page-2").addEventListener('touchend', touchEnd,false);  


$('.play').on('click',function(){
	bgm.pause();
	$('.play').hide();
	$('.stop').show();
});
$('.stop').on('click',function(){
	bgm.play();
	$('.stop').hide();
	$('.play').show();
});


$('#p1-next').on('click',function(){
	$('#page-1').hide();
	page_2();
	bgm.play();
	$('#stop').hide();
	$('#play').show();
	$('#p2-start').show();
});


$('#p2-start').on('click',function(){
	$('#p2-start').remove();
	$('#logo').hide();
	canvas_p0();
})

function page_2(){
	$('#page-2').show();
	canvas_p2();
}

function page_3(){
	$('#header').hide();
	
	$('#page-2').hide();
	$('#page-11').show();
	$('html body section').css({
		'height':'auto',
		'overflow-y':'auto',
	});
	$('.p11-child').each(function(){
		var box = $(this);
		$(this).find('a').on('click',function(){
			box.fadeOut();
			$(this).parents('.p11-parent').find('.p11-title').trigger('click');
		});
	});
	$('.p11-title').each(function(){
		var on = true;
		$(this).on('click',function(){
			if(on){
				$(this).parents('.p11-parent').find('.p11-child').stop().fadeIn();
				on = false;
			}else{
				$(this).parents('.p11-parent').find('.p11-child').stop().fadeOut();
				on = true;
			}
		})
	});
}

var p2_timer_1,p2_timer_2,p3_timer_1,p4_timer_1,p5_timer_1,p5_timer_2,p6_timer_1,p7_timer_1,p8_timer_1,p8_timer_2,p8_timer_3,p9_timer_1,p9_timer_2;
var canvas_p2 = function(){
	container.addChild(p2_bg,p2_title,p2_words_1,p2_words_2,p2_words_3,p2_words_4,p2_words_5,p2_words_6,p2_man,p2_light,p2_pass,p2_pen,p2_laba,p2_book,p2_next);
	p2_bg.setTransform(16,475);
	p2_light.setTransform(190,555).alpha = 0;
	p2_man.setTransform(426,550).alpha = 0;
	p2_pass.setTransform(363,1352);
	p2_pen.setTransform(37,1412);
	p2_laba.setTransform(145,1265);
	p2_book.setTransform(661,1241);
	p2_title.setTransform(295,-500);
	p2_words_1.setTransform(160,735).alpha = 0;
	p2_words_2.setTransform(160,800).alpha = 0;
	p2_words_3.setTransform(160,869).alpha = 0;
	p2_words_4.setTransform(160,942).alpha = 0;
	p2_words_5.setTransform(160,1009).alpha = 0;
	p2_words_6.setTransform(160,1077).alpha = 0;
	p2_next.setTransform(333,1197).alpha = 0;
	p2_timer_1 = setInterval(function(){
		p2_pass.setTransform(363,1342);
		p2_pen.setTransform(37,1402);
		p2_laba.setTransform(145,1275);
		p2_book.setTransform(661,1251);
		setTimeout(function(){
			p2_pass.setTransform(363,1352);
			p2_pen.setTransform(37,1412);
			p2_laba.setTransform(145,1265);
			p2_book.setTransform(661,1241);
		},250);
	},500);
	
	createjs.Tween.get(p2_title).to({
		y:  553,
	}, 500).to({
		y:  543,
	}, 100).to({
		y:  553,
	}, 100).call(function(){
		createjs.Tween.get(p2_words_1).to({
			alpha:  1,
		}, 200).call(function(){
			createjs.Tween.get(p2_words_2).to({
				alpha:  1,
			}, 200).call(function(){
				createjs.Tween.get(p2_words_3).to({
					alpha:  1,
				}, 200).call(function(){
					createjs.Tween.get(p2_words_4).to({
						alpha:  1,
					}, 200).call(function(){
						createjs.Tween.get(p2_words_5).to({
							alpha:  1,
						}, 200).call(function(){
							createjs.Tween.get(p2_words_6).to({
								alpha:  1,
							}, 200).call(function(){
								createjs.Tween.get(p2_next).to({
									alpha:  1,
								}, 200).call(function(){
									p2_timer_2 = setInterval(function(){
										p2_man.y = 540;
										p2_man.alpha = 1;
										p2_light.alpha = 1;
										setTimeout(function(){
											p2_man.y = 550;
											p2_light.alpha = 0;
										},250);
									},500);
									
									p2_next.on('click',function(){
										$('#logo').hide();
										canvas_p0();
									})
								})
							})
						})
					})
				})
			})
		})
	})
}
var canvas_p0 = function(){
	// 离场
	clearInterval(p2_timer_1,p2_timer_2);
	var speed = 300;
	var data_p2 = [p2_bg,p2_title,p2_words_1,p2_words_2,p2_words_3,p2_words_4,p2_words_5,p2_words_6,p2_man,p2_light,p2_pass,p2_pen,p2_laba,p2_book,p2_next];
	$('.p2-container').addClass('p0-bg');
	$.each(data_p2,function(i,arr){
		createjs.Tween.get(arr).to({x: -900}, speed).call(function(){
			container.removeChild(arr);
		});
	})
	
	// 进场
	p0_man.setTransform(190, 1103).y = 2100;
	p0_fly_1.setTransform(61, 539).y = -400;
	p0_fly_2.setTransform(318, 514).y = -400;
	p0_fly_3.setTransform(572, 559).y = -400;
	p0_stars.setTransform(123, 1078).alpha = 0;
	p0_title_1.setTransform(85, 850).y = -300;
	p0_title_2.setTransform(163, 862).y = -300;
	p0_title_3.setTransform(32, 850).y = -300;
	container.addChild(p0_man,p0_fly_1,p0_fly_2,p0_fly_3,p0_stars,p0_title_1,p0_title_2,p0_title_3);
	
	
	createjs.Tween.get(p0_man).to({y: 1103}, speed);
	createjs.Tween.get(p0_title_1).to({y: 850}, 500).to({y: 830}, 100).to({y: 850}, 100).wait(300).call(function(){
		createjs.Tween.get(p0_title_1).wait(300).to({y: 2100}, 500);
		createjs.Tween.get(p0_title_2).to({y: 862}, 500).to({y: 842}, 100).to({y: 862}, 100).wait(300).call(function(){
			createjs.Tween.get(p0_title_2).wait(300).to({y: 2100}, 500);
			createjs.Tween.get(p0_title_3).to({y: 850}, 500).to({y: 830}, 100).to({y: 850}, 100).call(function(){
				createjs.Tween.get(p0_stars,{loop:true}).to({alpha: 1}, 500).to({alpha: 0}, 500);
				createjs.Tween.get(p0_fly_1).to({y: 539}, 500).to({y: 519}, 100).to({y: 539}, 100).call(function(){
					createjs.Tween.get(p0_fly_1,{loop:true}).to({y: 519}, 500).to({y: 539}, 500);
				});
				createjs.Tween.get(p0_fly_2).to({y: 514}, 500).to({y: 494}, 100).to({y: 514}, 100).call(function(){
					createjs.Tween.get(p0_fly_2,{loop:true}).to({y: 494}, 500).to({y: 514}, 500);
				});
				createjs.Tween.get(p0_fly_3).to({y: 559}, 500).to({y: 539}, 100).to({y: 559}, 100).call(function(){
					createjs.Tween.get(p0_fly_3,{loop:true}).to({y: 539}, 500).to({y: 559}, 500);
				});
				
				move_on = true;
				start_next(0);
			});
		});
	});
}
var p0_next = function(){
	// 离场
	var speed = 300;
	var data_p2 = [p0_man,p0_fly_1,p0_fly_2,p0_fly_3,p0_stars,p0_title_1,p0_title_2,p0_title_3];
	$('.p2-container').addClass('p3-bg');
	$.each(data_p2,function(i,arr){
		createjs.Tween.get(arr).to({x: -900}, speed).call(function(){
			container.removeChild(arr);
		});
	});
	setTimeout(function(){
		canvas_p3();
	},speed);
}
var canvas_p3 = function(){
	container.removeAllChildren();
	
	var speed = 300;
	
	container.addChild(p3_tortoise,p3_man,p3_paper_1,p3_paper_2,p3_paper_3,p3_paper_4,p3_paper_5,p3_paper_6,p3_shake_1,p3_shake_2);
	
	p3_tortoise.setTransform(318,1422).x = 900;
	p3_man.setTransform(466,1440,1,1,0,0,0,240,698).x = 900;
	p3_paper_1.setTransform(63,1341).x = 900;
	p3_paper_2.setTransform(198,1420).x = 900;
	p3_paper_3.setTransform(53,1455).x = 900;
	p3_paper_4.setTransform(707,1298).x = 900;
	p3_paper_5.setTransform(622,1360).x = 900;
	p3_paper_6.setTransform(593,1478).x = 900;
	p3_shake_1.setTransform(125,910).x = 900;
	p3_shake_2.setTransform(125,910).alpha = 0;
	p3_shake_2.setTransform(125,910).x = 900;
	
	createjs.Tween.get(p3_tortoise).to({x: 318}, speed);
	createjs.Tween.get(p3_man).to({x: 466}, speed);
	createjs.Tween.get(p3_paper_1).to({x: 63}, speed);
	createjs.Tween.get(p3_paper_2).to({x: 198}, speed);
	createjs.Tween.get(p3_paper_3).to({x: 53}, speed);
	createjs.Tween.get(p3_paper_4).to({x: 707}, speed);
	createjs.Tween.get(p3_paper_5).to({x: 622}, speed);
	createjs.Tween.get(p3_paper_6).to({x: 593}, speed);
	createjs.Tween.get(p3_shake_1).to({x: 125}, speed);
	createjs.Tween.get(p3_shake_2).to({x: 125}, speed);
	
	p3_timer_1 = setInterval(function(){
		p3_shake_1.alpha = 0;
		p3_shake_2.alpha = 1;
		setTimeout(function(){
			p3_shake_1.alpha = 1;
			p3_shake_2.alpha = 0;
		},250);
	},500);
	setTimeout(function(){
		$('#p3-title').addClass('title_active');	
		createjs.Tween.get(p3_man, {loop: true}).to({rotation: 10},400).to({rotation: 0},400);
		createjs.Tween.get(p3_paper_1, {loop: true}).to({y: 1321},500).to({y: 1341},500);
		createjs.Tween.get(p3_paper_2, {loop: true}).to({x: 208, y: 1430},500).to({x: 198, y: 1420},500);
		createjs.Tween.get(p3_paper_3, {loop: true}).to({x: 43},500).to({x: 53},500);
		createjs.Tween.get(p3_paper_4, {loop: true}).to({y: 1278},500).to({y: 1298},500);
		createjs.Tween.get(p3_paper_5, {loop: true}).to({x: 632},500).to({x: 622},500);
		createjs.Tween.get(p3_paper_6, {loop: true}).to({y: 1458},500).to({y: 1478},500);	
	},300);
	
	move_on = true;
	start_next(2);
}
var canvas_p4 = function(){
	$('.p0-bg').removeClass('p0-bg');
	$('.p3-bg').removeClass('p3-bg');
	clearInterval(p3_timer_1);
	$('#logo').show();
	container.removeAllChildren();
	$('.p2-container').css({'backgroundColor':'#40b9a5'});
	
	container.addChild(p4_fly_1,p4_fly_2,p4_cloud_1,p4_cloud_2,p4_cloud_3,p4_cloud_4,p4_bg);
	p4_fly_1.setTransform(609,931);
	p4_fly_2.setTransform(600,863).alpha = 0;
	p4_cloud_1.setTransform(33,740);
	p4_cloud_2.setTransform(186,892);
	p4_cloud_3.setTransform(447,710);
	p4_cloud_4.setTransform(715,845);
	p4_bg.setTransform(0,812);
	
	title_down('p4-title');
	createjs.Tween.get(p4_cloud_1, {loop: true}).to({x: 45},500).to({x: 33},500);
	createjs.Tween.get(p4_cloud_2, {loop: true}).to({x: 200},500).to({x: 186},500);
	createjs.Tween.get(p4_cloud_3, {loop: true}).to({x: 425},500).to({x: 447},500);
	createjs.Tween.get(p4_cloud_4, {loop: true}).to({x: 700},500).to({x: 715},500);
	
	p4_timer_1 = setInterval(function(){
		p4_fly_1.alpha = 0;
		p4_fly_2.alpha = 1;
		setTimeout(function(){
			p4_fly_1.alpha = 1;
			p4_fly_2.alpha = 0;
		},150);
	},300);
	
	start_next(1);
}
var canvas_p5 = function(){
	clearInterval(p4_timer_1);
	$('#logo').hide();
	container.removeAllChildren();
	$('.p2-container').css({'backgroundColor':'#ffd243'});
	
	container.addChild(p5_bg,p5_person_1,p5_person_2,p5_hand_1,p5_hand_2,p5_hand_3,p5_hand_4,p5_gas_1,p5_gas_2,p5_gas_3);
	p5_bg.setTransform(0,1139);
	p5_person_1.setTransform(149,765);
	p5_person_2.setTransform(480,803);
	p5_hand_1.setTransform(166,851);
	p5_hand_2.setTransform(199,851).alpha = 0
	p5_hand_3.setTransform(552,906);
	p5_hand_4.setTransform(561,840).alpha = 0
	p5_gas_1.setTransform(295,1097);
	p5_gas_2.setTransform(257,1219);
	p5_gas_3.setTransform(540,1194);
	
	title_down('p5-title');
	createjs.Tween.get(p5_gas_1,{loop:true}).to({y: 1080},500).to({y: 1097},500);
	createjs.Tween.get(p5_gas_2,{loop:true}).to({x: 247, y: 1209},500).to({x: 257, y: 1219},500);
	createjs.Tween.get(p5_gas_3,{loop:true}).to({x: 550, y: 1184},500).to({x: 540, y: 1194},500);
	
	p5_timer_1 = setInterval(function(){
		p5_hand_1.alpha = 0;
		p5_hand_2.alpha = 1;
		setTimeout(function(){
			p5_hand_1.alpha = 1;
			p5_hand_2.alpha = 0;
		},150);
	},300);
	
	p5_timer_2 = setInterval(function(){
		p5_hand_3.alpha = 0;
		p5_hand_4.alpha = 1;
		setTimeout(function(){
			p5_hand_3.alpha = 1;
			p5_hand_4.alpha = 0;
		},150);
	},300);
	
	start_next(2);
}
var canvas_p6 = function(){
	clearInterval(p5_timer_1);
	clearInterval(p5_timer_2);
	$('#logo').show();
	container.removeAllChildren();
	$('.p2-container').css({'backgroundColor':'#f9a743'});
	
	container.addChild(p6_bg,p6_book_1,p6_book_2,p6_stars_1,p6_stars_2,p6_mouse);
	p6_bg.setTransform(0,691);
	p6_book_1.setTransform(358,1019);
	p6_book_2.setTransform(670,890);
	p6_stars_1.setTransform(399,1004);
	p6_stars_2.setTransform(513,814).alpha = 0;
	p6_mouse.setTransform(610,1042);
	
	
	title_down('p6-title');
	createjs.Tween.get(p6_book_1,{loop:true}).to({x: 340, y: 1000},500).to({x: 358, y: 1019},500);
	createjs.Tween.get(p6_book_2,{loop:true}).to({x: 660, y: 904},500).to({x: 670, y: 890},500);
	createjs.Tween.get(p6_stars_1,{loop:true}).to({alpha: 0},500).to({alpha: 1},500);
	createjs.Tween.get(p6_stars_2,{loop:true}).to({alpha: 1},500).to({alpha: 0},500);
	
	
	p6_timer_1 = setInterval(function(){
		p6_mouse.alpha = 1;
		setTimeout(function(){
			p6_mouse.alpha = 0;
		},100);
	},200);
	
	start_next(1);
}
var canvas_p7 = function(){
	clearInterval(p6_timer_1);
	$('#logo').hide();
	container.removeAllChildren();
	$('.p2-container').css({'backgroundColor':'#5a49a5'});
	
	container.addChild(p7_bg,p7_fruit_1,p7_fruit_2,p7_fruit_3,p7_fruit_4,p7_fruit_5,p7_man,p7_paper,p7_fly);

	p7_bg.setTransform(56,844);
	p7_man.setTransform(285,977);
	p7_fly.setTransform(291,991);
	p7_paper.setTransform(581,1290);
	p7_fruit_1.setTransform(221,1080);
	p7_fruit_2.setTransform(180,1170);
	p7_fruit_3.setTransform(717,1047);
	p7_fruit_4.setTransform(712,1142);
	p7_fruit_5.setTransform(717,1245);
	
	
	title_down('p7-title');
	createjs.Tween.get(p7_fruit_1,{loop:true}).to({x: 205, y: 1065},500).to({x: 221, y: 1080},500);
	createjs.Tween.get(p7_fruit_2,{loop:true}).to({x: 192, y: 1189},500).to({x: 180, y: 1170},500);
	createjs.Tween.get(p7_fruit_3,{loop:true}).to({x: 730, y: 1030},500).to({x: 717, y: 1047},500);
	createjs.Tween.get(p7_fruit_4,{loop:true}).to({x: 702, y: 1152},500).to({x: 712, y: 1142},500);
	createjs.Tween.get(p7_fruit_5,{loop:true}).to({x: 730, y: 1230},500).to({x: 717, y: 1245},500);
	createjs.Tween.get(p7_paper,{loop:true}).to({x: 590, y: 1275},500).to({x: 581, y: 1290},500);
	createjs.Tween.get(p7_man,{loop:true}).to({x: 291, y: 960},333).to({x: 288, y: 965},333).to({x: 285, y: 977},333);
	
	
	p7_timer_1 = setInterval(function(){
		p7_fly.y = 975;
		setTimeout(function(){
			p7_fly.y = 991;
		},150);
	},300);
	
	start_next(2);
}
var canvas_p8 = function(){
	clearInterval(p7_timer_1);
	$('#logo').show();
	container.removeAllChildren();
	$('.p2-container').css({'backgroundColor':'#0b5dac'});
	
	container.addChild(p8_bg,p8_rope_1,p8_rope_2,p8_rope_3,p8_fly_1,p8_fly_2,p8_fly_3,p8_hand_1,p8_hand_2,p8_hand_3,p8_hand_4);
	p8_bg.setTransform(213,944);
	p8_rope_1.setTransform(76,1107);
	p8_rope_2.setTransform(71,1084).alpha = 0;
	p8_rope_3.setTransform(72,1074).alpha = 0;
	p8_fly_1.setTransform(26,944);
	p8_fly_2.setTransform(213,936);
	p8_fly_3.setTransform(90,936);
	p8_fly_4.setTransform(26,1074);
	p8_hand_1.setTransform(330,930);
	p8_hand_2.setTransform(296,968).alpha = 0;
	p8_hand_3.setTransform(635,960);
	p8_hand_4.setTransform(626,993).alpha = 0;
	
	
	title_down('p8-title');
	createjs.Tween.get(p8_fly_1,{loop:true}).to({x: 36, y: 954},500).to({x: 26, y: 944},500);
	createjs.Tween.get(p8_fly_2,{loop:true}).to({x: 223, y: 916},500).to({x: 213, y: 936},500);
	createjs.Tween.get(p8_fly_3,{loop:true}).to({x: 80, y: 920},500).to({x: 90, y: 936},500);
	createjs.Tween.get(p8_fly_4,{loop:true}).to({y: 1060},500).to({y: 1074},500);
	
	
	p8_timer_1 = setInterval(function(){
		p8_rope_1.alpha = 0;
		p8_rope_2.alpha = 1;
		setTimeout(function(){
			p8_rope_2.alpha = 0;
			p8_rope_3.alpha = 1;
			setTimeout(function(){
				p8_rope_3.alpha = 0;
				p8_rope_1.alpha = 1;
			},150);
		},150);
	},450);
	
	p8_timer_2 = setInterval(function(){
		p8_hand_1.alpha = 0;
		p8_hand_2.alpha = 1;
		setTimeout(function(){
			p8_hand_1.alpha = 1;
			p8_hand_2.alpha = 0;
		},150);
	},300);
	
	p8_timer_3 = setInterval(function(){
		p8_hand_3.alpha = 0;
		p8_hand_4.alpha = 1;
		setTimeout(function(){
			p8_hand_3.alpha = 1;
			p8_hand_4.alpha = 0;
			setTimeout(function(){
				p8_hand_3.alpha = 0;
				p8_hand_4.alpha = 1;
				setTimeout(function(){
					p8_hand_3.alpha = 1;
					p8_hand_4.alpha = 0;
				},150);
			},150);
		},150);
	},900);
	
	start_next(1);
}
var canvas_p9 = function(){
	clearInterval(p8_timer_1);
	clearInterval(p8_timer_2);
	clearInterval(p8_timer_3);
	$('#logo').hide();
	container.removeAllChildren();
	$('.p2-container').css({'backgroundColor':'#626262'});
	
	container.addChild(p9_bg,p9_stars_1,p9_stars_2,p9_stars_3,p9_fly_1,p9_fly_2,p9_fly_3,p9_fly_4,p9_hand_1,p9_hand_2,p9_hand_3,p9_hand_4,p9_compture);
	p9_bg.setTransform(0,957);
	p9_stars_1.setTransform(788,1005);
	p9_stars_2.setTransform(811,1114);
	p9_stars_3.setTransform(876,1105);
	p9_fly_1.setTransform(153,1020);
	p9_fly_2.setTransform(371,1205);
	p9_fly_3.setTransform(484,1210);
	p9_fly_4.setTransform(484,1210).alpha = 0;
	p9_hand_1.setTransform(37,1307);
	p9_hand_2.setTransform(41,1265).alpha = 0;
	p9_hand_3.setTransform(116,1307);
	p9_hand_4.setTransform(120,1259).alpha = 0;
	p9_compture.setTransform(0,1146);
	
	
	title_down('p9-title');
	
	createjs.Tween.get(p9_fly_1,{loop:true}).to({x: 145, y: 1015},333).to({x: 150, y: 1010},333).to({x: 153, y: 1020},333);
	createjs.Tween.get(p9_fly_2,{loop:true}).to({x: 381, y: 1210},333).to({x: 376, y: 1200},333).to({x: 371, y: 1205},333);
	createjs.Tween.get(p9_stars_1,{loop:true}).to({alpha: 0},500).to({alpha: 1},500);
	createjs.Tween.get(p9_stars_2,{loop:true}).to({alpha: 0},400).to({alpha: 1},400);
	createjs.Tween.get(p9_stars_3,{loop:true}).to({alpha: 0},300).to({alpha: 1},300);
	
	
	p9_timer_1 = setInterval(function(){
		p9_fly_3.alpha = 0;
		p9_fly_4.alpha = 1;
		p9_hand_1.alpha = 0;
		p9_hand_2.alpha = 1;
		setTimeout(function(){
			p9_fly_3.alpha = 1;
			p9_fly_4.alpha = 0;
			p9_hand_1.alpha = 1;
			p9_hand_2.alpha = 0;
			setTimeout(function(){
				p9_fly_3.alpha = 0;
				p9_fly_4.alpha = 1;
				p9_hand_1.alpha = 0;
				p9_hand_2.alpha = 1;
				setTimeout(function(){
					p9_fly_3.alpha = 1;
					p9_fly_4.alpha = 0;
					p9_hand_1.alpha = 1;
					p9_hand_2.alpha = 0;
				},150);
			},150);
		},150);
	},800);
	
	p9_timer_2 = setInterval(function(){
		p9_hand_3.alpha = 0;
		p9_hand_4.alpha = 1;
		setTimeout(function(){
			p9_hand_3.alpha = 1;
			p9_hand_4.alpha = 0;
			setTimeout(function(){
				p9_hand_3.alpha = 0;
				p9_hand_4.alpha = 1;
				setTimeout(function(){
					p9_hand_3.alpha = 1;
					p9_hand_4.alpha = 0;
				},130);
			},130);
		},130);
	},700);
	
	
	start_next(2);
}
var canvas_p10 = function(){
	clearInterval(p9_timer_1);
	clearInterval(p9_timer_2);
	$('#logo').show();
	container.removeAllChildren();
	$('.p2-container').css({'backgroundColor':'#cb0c1b'});
	
	container.addChild(p10_bg,p10_fly_1,p10_fly_2,p10_cloud_1,p10_cloud_2,p10_cloud_3,p10_cloud_4,p10_cloud_5);

	p10_bg.setTransform(211,1145);
	
	
	p10_fly_1.setTransform(0,984);
	p10_fly_2.setTransform(0,990);
	p10_cloud_1.setTransform(25,945);
	p10_cloud_2.setTransform(262,859);
	p10_cloud_3.setTransform(517,799);
	p10_cloud_4.setTransform(586,881);
	p10_cloud_5.setTransform(745,990);
	
	
	title_down('p10-title');
	
	
	createjs.Tween.get(p10_fly_1,{loop:true}).to({y: 974},500).to({y: 984},500);
	createjs.Tween.get(p10_fly_2,{loop:true}).to({y: 995},500).to({y: 990},500);
	
	
	createjs.Tween.get(p10_cloud_1,{loop:true}).to({x: 10, y: 943},300).to({x: 12, y: 935},300).to({x: 25, y: 945},300);
	createjs.Tween.get(p10_cloud_2,{loop:true}).to({x: 252, y: 850},300).to({x: 250, y: 845},300).to({x: 262, y: 859},300);
	createjs.Tween.get(p10_cloud_3,{loop:true}).to({y: 790},300).to({y: 788},300).to({y: 799},300);
	createjs.Tween.get(p10_cloud_4,{loop:true}).to({x: 576},300).to({x: 570},300).to({x: 586},300);
	createjs.Tween.get(p10_cloud_5,{loop:true}).to({y: 980},450).to({y: 990},450);
	
	
	start_next();
}
var title_down = function(title){
	setTimeout(function(){
		$('#'+title).addClass('title_active');	
	},500);
}


var start_next_timer;
var start_next = function(tips){
	tips_num = tips;
	
	clearInterval(start_next_timer);
	footer.setTransform(700, 1525,1,1);
	//遮罩图形
	shape = new createjs.Shape();
	shape.graphics.drawRect(154, 1525, 546 ,64);
	footer.mask = shape;     //给图片bg添加遮罩
	container.addChild(footer);
	var x = 700,gap = 42,end_x = 154;
	start_next_timer = setInterval(function(){
		x -= gap;
		if(x == end_x){
			x = 700
		}
		footer.x = x;
	},120);
}
var canvas_open = function(fun){
	setTimeout(function(){
		eval(fun+"()");
		$('#close-left').animate({'left':'-640px'});
		$('#close-right').animate({'right':'-640px'});
		$('#tips-1').hide();
		$('#tips-2').hide();
	},load_time);
	setTimeout(function(){
		move_on = true;
	},1000);
		
}
var canvas_close = function(tips,part){
	
	$('#close-left').animate({'left':'0px'},600);
	$('#close-right').animate({'right':'0px'},600);
	
	setTimeout(function(){
		$('.title_active').removeClass('title_active');
		if(tips == 1){
			$('#tips-1').show();
		}else if(tips == 2){
			$('#tips-2').show();
		}
		canvas_open(part);
	},600)
}
